package com.accp.restaurant.dao;

import com.accp.restaurant.entity.Permission;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface PermissionDao extends JpaRepository<Permission,Long> {


    @Query(value = "select * from Permission p inner join rolePermission rp on p.perid=rp.perid where rp.roleid=:roleid",nativeQuery = true)
    public List<Permission> getAll(@Param("roleid") long roleid);

}
